package com.manli.common.utils.qiniu;

import com.alibaba.fastjson.JSONObject;
import com.manli.common.utils.HttpUtil;
import com.manli.common.utils.HttpUtils;

/**
 * 腾讯地图工具类
 */
public class TencentMapUtils {
    private static String key = "EIHBZ-JRJWG-2AIQI-IKDTM-6ZMO2-UTB3R";

    /**
     * 通过经纬度获取位置
     * @return
     */
    public static JSONObject getLocationByLatLng(String lat , String lng ,String poi) throws Exception {
        return JSONObject.parseObject(HttpUtil.httpsGet("https://apis.map.qq.com/ws/geocoder/v1/?location="+lat+","+lng+"&key="+key+"&get_poi="+poi));
    }

    public static void main(String[] args) throws Exception {
        System.out.println(TencentMapUtils.getLocationByLatLng("27.781187","120.463097","0"));
    }
}
